export function isLogin() {
  const token = uni.getStorageSync('userToken')
  return !!token
}

export function requireLogin() {
  if (!isLogin()) {
    uni.showToast({
      title: '请先登录',
      icon: 'none'
    })
    setTimeout(() => {
      uni.navigateTo({ url: '/pages/login/index' })
    }, 1000)
    return false
  }
  return true
}